package com.juku2024.juku.db.dao;


import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import com.juku2024.juku.db.entity.VideoDetailModel;

import java.util.List;


@Dao
public interface VideoDetailDao {

    @Query("SELECT * FROM videoDetailTable WHERE id=:id")
    VideoDetailModel query(long id);

    @Query("SELECT id FROM videoDetailTable")
    List<Long> queryAll();

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(VideoDetailModel videoDetailEntity);

    @Update
    void update(VideoDetailModel videoDetailEntity);

    @Delete
    void delete(VideoDetailModel videoDetailEntity);

    @Query("DELETE FROM videoDetailTable WHERE id=:id")
    void delete(long id);


    @Query("DELETE FROM videoDetailTable")
    void deleteAll();

}
